<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:composition template="layout.xhtml">

        <ui:define name="title">
            Campo do Ato
        </ui:define>
        <ui:define name="content">
            <h:form id="criarAtoCampoForm">

                <p:messages id="criarAtoCampoMessages" autoUpdate="true" />

                <p:fieldset legend="Dados" id="criarAtoCampoPanel" >


                    <div class="row">
                        <div class="column2">
                            <p:outputLabel value="Nome" for="nomeInputText" />
                        </div>
                        <div class="column8">
                            <p:inputText id="nomeInputText" value="#{ managerCriarAtoCampo.atoCampo.nome }"
                                         required="true" requiredMessage="Nome é obrigatório" />
                        </div>
                    </div>

                    <div class="row">
                        <div class="column2">
                            <p:outputLabel value="Tipo" for="tipoSelectOneMenu" />
                        </div>
                        <div class="column3">
                            <p:selectOneMenu id="tipoSelectOneMenu" value="#{ managerCriarAtoCampo.atoCampo.tipo }"
                                             required="true" requiredMessage="Tipo é obrigatório">
                                <f:selectItems value="#{ enums.tiposAtoCampo() }" />
                            </p:selectOneMenu>
                        </div>                        

                        <div class="column2">
                            <p:outputLabel value="Aplicação" for="aplicacaoSelectOneMenu" />
                        </div>                        
                        <div class="column3">
                            <p:selectOneMenu id="aplicacaoSelectOneMenu" value="#{ managerCriarAtoCampo.atoCampo.aplicacao }"
                                             required="true" requiredMessage="Tipo é obrigatório">
                                <f:selectItems value="#{ enums.aplicacoesCampo() }" />
                            </p:selectOneMenu>
                        </div>
                    </div>

                    <div class="command">
                        <p:commandButton actionListener="#{ managerCriarAtoCampo.salvar() }"
                                         value="Salvar" update="@form" 
                                         styleClass="ui-priority-primary" 
                                         icon="ui-icon-disk"  onsuccess="goY(0);"/>
                        <p:button value="Cancelar" icon="ui-icon-cancel" href="pesquisarAtoCampo.xhtml" />
                    </div>



                </p:fieldset>

            </h:form>

        </ui:define>
    </ui:composition>

</html>